package com.r2coding.music.controller;

import org.springframework.beans.factory.annotation.Autowired;

import com.r2coding.music.entity.MvCommentEntity;
import com.r2coding.music.service.MvCommentService;
import com.r2coding.common.util.Result;
import org.springframework.web.bind.annotation.*;

/**
 * 评论信息
 *
 * @author 98k灬
 * @email hk666zx@163.com
 * @date 2022-05-19 23:19:59
 */
@RestController
@RequestMapping("/mvcomment")
public class MvCommentController {
    @Autowired
    private MvCommentService mvCommentService;

    /**
     * 保存
     */
    @PostMapping("/save")
    public Result save(@RequestBody MvCommentEntity mvComment){
		mvCommentService.save(mvComment);
        return Result.ok();
    }

    /**
     * 修改
     */
    @PutMapping("/update")
    public Result update(@RequestBody MvCommentEntity mvComment){
		mvCommentService.updateById(mvComment);
        return Result.ok();
    }

    /**
     * 删除
     */
    @DeleteMapping("/delete/{id}")
    public Result delete(@PathVariable("id") Integer id){
		mvCommentService.removeById(id);
        return Result.ok();
    }
}
